package common;

import java.io.Serializable;

//Keeps track on the GUI control for each player, f.ex. if a button should be enabled.
public class PlayerGUIControl implements Serializable {
	private static final long serialVersionUID = 1L;
	private boolean button;
	private int diceNumberRolled;
	private boolean diceRolled;

	public PlayerGUIControl() {
		initialSetup();
	}

	public void initialSetup() {
		this.button = true;
		this.diceRolled = false;
	}

	public void diceRolled(final int i) {
		if (!this.diceRolled) {
			this.diceNumberRolled = i;
			setButtonState(false);
			this.diceRolled = true;
		}
	}

	public void tileChoosen() {
		setButtonState(true);
		this.diceNumberRolled = 0;
		this.diceRolled = false;
	}

	public boolean isDiceRolled() {
		return this.diceRolled;
	}

	public boolean getButtonState() {
		return this.button;
	}

	public void setButtonState(final boolean b) {
		this.button = b;
	}

	public int getDiceNumberRolled() {
		return this.diceNumberRolled;
	}

}
